package com.study.mynew.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.study.mynew.R;
import com.study.mynew.bean.NewItemBean;

public class NewItemAdapter extends BaseQuickAdapter<NewItemBean, BaseViewHolder> {
    public NewItemAdapter() {
        super(R.layout.item_image_news);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, NewItemBean newItemBean) {
            Glide.with(getContext()).load(newItemBean.getThumbnail_pic_s()).error(R.drawable.imageconfig).into((ImageView) baseViewHolder.getView(R.id.imageView));
            baseViewHolder.setText(R.id.tvTitle,newItemBean.getTitle()).setText(R.id.tvPublisher,newItemBean.getAuthor_name()).setText(R.id.tvDate,newItemBean.getDate());
    }
}
